#ifndef JSONPARSER_H
#define JSONPARSER_H
#include <Arduino.h>
#include "Parser.h"
#include "WAMP.h"
#ifndef ARDUINOJSON_USE_LONG_LONG
#define ARDUINOJSON_USE_LONG_LONG 1
#endif
#include <ArduinoJson.h>

class cjsonparser:public Parser {
public:	
	const char * get_hello(const char * topic);
	const char * get_publish(int reqId,const char * topic,const char *payload);
    const char * get_subscribe(int reqId,const char * topic);

    int get_subscription_id(const uint8_t * data);
	int get_subscribe_request_id(const uint8_t * data);
	int getsessionID(const char * data);
    int getrequestID(const uint8_t * data);
    e_message_codes get_message_type(const uint8_t *  str);
    const char *geteventpayload(const uint8_t * payload);
    int  get_registration_id(const uint8_t * data);
    int  get_register_id(const uint8_t * data);
    const char * get_rpc_register(int reqId,const char * procedure);
    std::string  get_subscription_id_str(const uint8_t * data);
    std::string  get_subscribe_request_id_str(const uint8_t * data);
    const char * get_result(std::string reqId,const char * payload);
    const char * get_result(int reqId,const char * payload);    
    std::string   get_registration_id_str(const uint8_t * data);
    std::string get_register_id_str(const uint8_t * data);
    const char * get_rpccall(int reqId,const char * topic, char *payload);
    const char * get_unsubscribe(int reqId,std::string subid);	
    const char * geteventpayload_rpc(const uint8_t * payload);

private:
	JsonObject& GenerateRolesObject(JsonBuffer& buffer);
	char buffer[512];
};


#endif
